package com.kingdee.eas.custom.rcbudget.ekingwin.www.esb.error.v1;

import java.io.Serializable;
import java.util.Calendar;
import javax.xml.namespace.QName;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;

public class ErrorType
  implements Serializable
{
  private String errorCode;
  private String errorMessage;
  private Calendar timestamp;
  private Object errorDetails;
  private Object __equalsCalc = null;

  private boolean __hashCodeCalc = false;

  private static TypeDesc typeDesc = new TypeDesc(ErrorType.class, true);

  static {
    typeDesc.setXmlType(new QName("http://www.ekingwin.com/esb/error/v1", "errorType"));
    ElementDesc elemField = new ElementDesc();
    elemField.setFieldName("errorCode");
    elemField.setXmlName(new QName("http://www.ekingwin.com/esb/error/v1", "ErrorCode"));
    elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
    elemField.setNillable(false);
    typeDesc.addFieldDesc(elemField);
    elemField = new ElementDesc();
    elemField.setFieldName("errorMessage");
    elemField.setXmlName(new QName("http://www.ekingwin.com/esb/error/v1", "ErrorMessage"));
    elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    typeDesc.addFieldDesc(elemField);
    elemField = new ElementDesc();
    elemField.setFieldName("timestamp");
    elemField.setXmlName(new QName("http://www.ekingwin.com/esb/error/v1", "Timestamp"));
    elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "dateTime"));
    elemField.setNillable(false);
    typeDesc.addFieldDesc(elemField);
    elemField = new ElementDesc();
    elemField.setFieldName("errorDetails");
    elemField.setXmlName(new QName("http://www.ekingwin.com/esb/error/v1", "ErrorDetails"));
    elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "anyType"));
    elemField.setMinOccurs(0);
    elemField.setNillable(false);
    typeDesc.addFieldDesc(elemField);
  }

  public ErrorType()
  {
  }

  public ErrorType(String errorCode, String errorMessage, Calendar timestamp, Object errorDetails)
  {
    this.errorCode = errorCode;
    this.errorMessage = errorMessage;
    this.timestamp = timestamp;
    this.errorDetails = errorDetails;
  }

  public String getErrorCode()
  {
    return this.errorCode;
  }

  public void setErrorCode(String errorCode)
  {
    this.errorCode = errorCode;
  }

  public String getErrorMessage()
  {
    return this.errorMessage;
  }

  public void setErrorMessage(String errorMessage)
  {
    this.errorMessage = errorMessage;
  }

  public Calendar getTimestamp()
  {
    return this.timestamp;
  }

  public void setTimestamp(Calendar timestamp)
  {
    this.timestamp = timestamp;
  }

  public Object getErrorDetails()
  {
    return this.errorDetails;
  }

  public void setErrorDetails(Object errorDetails)
  {
    this.errorDetails = errorDetails;
  }

  public synchronized boolean equals(Object obj)
  {
    if (!(obj instanceof ErrorType)) return false;
    ErrorType other = (ErrorType)obj;
    if (obj == null) return false;
    if (this == obj) return true;
    if (this.__equalsCalc != null) {
      return this.__equalsCalc == obj;
    }
    this.__equalsCalc = obj;

    boolean _equals = 
      ((this.errorCode == null) && (other.getErrorCode() == null)) || (
      (this.errorCode != null) && 
      (this.errorCode.equals(other.getErrorCode())) && (
      ((this.errorMessage == null) && (other.getErrorMessage() == null)) || (
      (this.errorMessage != null) && 
      (this.errorMessage.equals(other.getErrorMessage())) && (
      ((this.timestamp == null) && (other.getTimestamp() == null)) || (
      (this.timestamp != null) && 
      (this.timestamp.equals(other.getTimestamp())) && (
      ((this.errorDetails == null) && (other.getErrorDetails() == null)) || (
      (this.errorDetails != null) && 
      (this.errorDetails.equals(other.getErrorDetails())))))))));
    this.__equalsCalc = null;
    return _equals;
  }

  public synchronized int hashCode()
  {
    if (this.__hashCodeCalc) {
      return 0;
    }
    this.__hashCodeCalc = true;
    int _hashCode = 1;
    if (getErrorCode() != null) {
      _hashCode += getErrorCode().hashCode();
    }
    if (getErrorMessage() != null) {
      _hashCode += getErrorMessage().hashCode();
    }
    if (getTimestamp() != null) {
      _hashCode += getTimestamp().hashCode();
    }
    if (getErrorDetails() != null) {
      _hashCode += getErrorDetails().hashCode();
    }
    this.__hashCodeCalc = false;
    return _hashCode;
  }

  public static TypeDesc getTypeDesc()
  {
    return typeDesc;
  }

  public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType)
  {
    return 
      new BeanSerializer(
      _javaType, _xmlType, typeDesc);
  }

  public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType)
  {
    return 
      new BeanDeserializer(
      _javaType, _xmlType, typeDesc);
  }
}